﻿namespace My.Hydrator.Formatters
{
    using System.ComponentModel.Composition;
    using System.ComponentModel.DataAnnotations;

    [Export(typeof(IDataTypeFormatter))]
    public class PhoneDataTypeFormatter : BaseDataTypeFormatter, IDataTypeFormatter
    {
        public virtual DataTypeAttribute FormatterDataType
        {
            get { return new DataTypeAttribute(DataType.PhoneNumber); }
        }

        public virtual object GetFormat()
        {
            return string.Format("{0}-{1}-{2}", this.GetThreeDigitNumber(), this.GetThreeDigitNumber(), this.GetThreeDigitNumber());
        }
    }
}
